import axios from 'axios';

/**
 * 获取手机验证码
 * @param cellphone 手机号码
 */
export function getVerificationCode(cellphone) {
  return axios.get(`/propagation/users/security_code?cellphone=${cellphone}`);
}

/**
 * 获取地区信息
 * @param geoId
 * @returns {{res, content}|String}
 */
export function getAreaByGeoId(geoId) {
  return axios.get(`/propagation/area?geoId=${geoId}`);
}

/**
* 注册新用户
* @param jsonBody
*/
export function register(jsonBody) {
  return axios.post('/propagation/users/register', jsonBody);
}

/**
 * 使用邀请码注册新用户
 * @param jsonBody
 */
export function registerByInviteCode(inviteCode, jsonBody) {
  return axios.post(`/propagation/users/register/${inviteCode}`, jsonBody);
}
